package com;

import java.util.ArrayList;
import java.util.Scanner;

public class modify {
    public static  void modify(ArrayList<student> st){
        System.out.println("请输入需要修改的学生的id");
        Scanner sc = new Scanner(System.in);
        String uid = sc.next();
        for (int i = 0; i < st.size(); i++) {
            if(uid.equals(st.get(i).getId()))
            {
                System.out.println("请输入修改后的名字:");
                String name = sc.next();
                st.get(i).setName(name);
                System.out.println("请输入修改后的年龄:");
                int age = sc.nextInt();
                st.get(i).setAge(age);
            }
        }

    }
}
